<template>
  <div class="content">
    <div v-for="v in mlist" :key="v.id" class="item" @click="play(v)">
      <div class="item_div1">
        <img :src="v.albumPicUrl" />
      </div>
      <div class="item_div2">
        <p>歌名：{{ v.musicName }}</p>
        <p>专辑：{{ v.albumName }}</p>
        <p>歌手：{{ v.artistName }}</p>
        <p>类型：{{ v.navigationName }}</p>
      </div>
    </div>
  </div>
</template>
<script>
import url from "../tools/url";
export default {
  name: "Navdetail",
  data() {
    return {
      mlist: [],
    };
  },
  methods: {
    play(v) {
      this.$store.commit("savem", v);
    },
  },
  mounted() {},
  watch: {
    $route: {
      handler(path) {
        var id = JSON.parse(sessionStorage.getItem("active"));
        if (!id) {
          id = 1;
        }
        var token = sessionStorage.getItem("token");
        var str = `id=${id}&token=${token}`;
        this.axios.post(url.GET_RECO_FINGALL, str).then((res) => {
          console.log(res);
          if (res.data.code == 200) {
            this.mlist = res.data.data;
          } else {
            this.$router.push("/login");
          }
        });
      },
      immediate: true,
    },
  },
};
</script>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
.item {
  display: flex;
  background: white;
  margin-top: 10px;
  padding: 10px;
}
.item .item_div1 {
  width: 20%;
}
.item .item_div1 img {
  width: 80%;
  border-radius: 50%;
}
.item .item_div2 {
  margin-left: 10px;
}
.item div {
  width: 75%;
  font-size: 10px;
}
.content {
  margin-top: 10px;
  margin-bottom: 60px;
}
</style>
